package TestDemo;


import java.util.Objects;

class A {
    Integer a;

    @Override
    public String toString() {
        return "A{" +
                "a=" + a +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        A a1 = (A) o;
        return Objects.equals(a, a1.a);
    }

    @Override
    public int hashCode() {
        return Objects.hash(a);
    }
}

public class TestDemo {
    public static void main(String[] args) {
        A a = new A();
        System.out.println(a);
    }
}
